package ru.ifmo.ctd.year2008.notepad.client;

import java.io.IOException;
import java.net.Socket;
import java.util.List;

import ru.ifmo.ctd.year2008.notepad.Text;

/**
 * User interface. 
 * Its implementation should contain {@link TextManager}.
 * 
 * @author Arina Afanasyeva
 */
public interface ClientInterface {
	/**
	 * @return list of available documents
	 */
	public List<String> getDocumentsList();
	
	public void sendDiff(List<String> modifiedText) throws IOException;

    public Socket connect(String host, int port);
	
	/**
	 * Opens the specified document for the further editing 
	 * or creates a new document if the {@code doc} doesn't exist.
	 * 
	 * @param doc the document to be opened or created
	 */
	public Text openToEdit(String doc);	
	
	public void receiveText();
	
	/**
	 * Closes the client.
	 */
	public void close();
}
